package com.region.http.client.resolver.result;

import com.region.http.client.annotation.Priority;
import com.region.http.client.model.ResponseData;

import java.lang.reflect.Type;

/**
 * Unified Results Processor Interface
 *
 * @author liujieyu
 * @date 2023/6/11 20:50
 * @desciption
 */
public interface ResultResolver extends Priority {

    /**
     * Determine if the current parser is being used to parse the data
     *
     * @param type The interface returns the object Class object
     * @return
     */
    boolean isResolver(Type type);

    /**
     * Converts the return result to the return type
     *
     * @see ResponseData
     * @param responseData all response data
     * @return Return the parsed object
     */
    Object resolver(ResponseData responseData) throws Throwable;

}
